package router

import (
	"gin_maker_chat/controller"

	"github.com/gin-gonic/gin"
)

func SetupRouter() *gin.Engine {
	r := gin.Default()

	r.Static("/assets", "./assets")

	r.LoadHTMLGlob("templates/*")

	r.GET("/register", controller.GoRegisterController)
	r.POST("/register", controller.RegisterIndexController)

	r.GET("/login", controller.GoLoginIndexController)
	r.POST("/login", controller.LoginIndexController)
	r.GET("/logout", controller.GoLogoutIndexController)
	r.GET("/index", controller.GoIndexController)
	r.GET("/lock", controller.GoLockScreenController)
	r.GET("/recover", controller.GoRecoverController)
	r.GET("/dark", controller.GoDarkController)
	r.GET("/rtl", controller.GoRtlController)
	//blog操作
	// blogRouter := r.Group("blog")
	// {
	// 	blogRouter.GET("/post_index", controller.GetPostController)
	// 	blogRouter.POST("/post", controller.AddPostController)
	// 	blogRouter.GET("/post", controller.GoAddPostController)
	// 	blogRouter.GET("/detail/:pid", controller.PostDetailController)
	// }

	return r
}
